package com.malie.myspringboot.designPattern.singleton;

/**
 * 静态内部类实现模式（线程安全，调用效率高，可以延时加载）
 */
public class Singleton3 {
    private static class SingletonClassInstance {
        private static final Singleton3 INSTANCE = new Singleton3();
    }

    private Singleton3() {
    }

    public static Singleton3 getInstance() {
        return SingletonClassInstance.INSTANCE;
    }

    public void show() {
        System.out.println("静态内部类");
    }
}
